<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="iso-8859-1">
<title>SMTPClient (Commons Net 3.3 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="SMTPClient (Commons Net 3.3 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SMTPClient.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/net/smtp/SMTP.html" title="class in org.apache.commons.net.smtp"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/net/smtp/SMTPCommand.html" title="class in org.apache.commons.net.smtp"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/net/smtp/SMTPClient.html" target="_top">Frames</a></li>
<li><a href="SMTPClient.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields_inherited_from_class_org.apache.commons.net.smtp.SMTP">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.net.smtp</div>
<h2 title="Class SMTPClient" class="title">Class SMTPClient</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/commons/net/SocketClient.html" title="class in org.apache.commons.net">org.apache.commons.net.SocketClient</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/commons/net/smtp/SMTP.html" title="class in org.apache.commons.net.smtp">org.apache.commons.net.smtp.SMTP</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.net.smtp.SMTPClient</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../org/apache/commons/net/smtp/SMTPSClient.html" title="class in org.apache.commons.net.smtp">SMTPSClient</a></dd>
</dl>
<hr>
<br>
<pre>public class <a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.125">SMTPClient</a>
extends <a href="../../../../../org/apache/commons/net/smtp/SMTP.html" title="class in org.apache.commons.net.smtp">SMTP</a></pre>
<div class="block">SMTPClient encapsulates all the functionality necessary to send files
 through an SMTP server.  This class takes care of all
 low level details of interacting with an SMTP server and provides
 a convenient higher level interface.  As with all classes derived
 from <a href="../../../../../org/apache/commons/net/SocketClient.html" title="class in org.apache.commons.net"><code>SocketClient</code></a>,
 you must first connect to the server with
 <a href="../../../../../org/apache/commons/net/SocketClient.html#connect(java.net.InetAddress, int)"><code>connect </code></a>
 before doing anything, and finally
 <a href="../../../../../org/apache/commons/net/SocketClient.html#disconnect()"><code>disconnect </code></a>
 after you're completely finished interacting with the server.
 Then you need to check the SMTP reply code to see if the connection
 was successful.  For example:
 <pre>
    try {
      int reply;
      client.connect("mail.foobar.com");
      System.out.print(client.getReplyString());

      // After connection attempt, you should check the reply code to verify
      // success.
      reply = client.getReplyCode();

      if(!SMTPReply.isPositiveCompletion(reply)) {
        client.disconnect();
        System.err.println("SMTP server refused connection.");
        System.exit(1);
      }

      // Do useful stuff here.
      ...
    } catch(IOException e) {
      if(client.isConnected()) {
        try {
          client.disconnect();
        } catch(IOException f) {
          // do nothing
        }
      }
      System.err.println("Could not connect to server.");
      e.printStackTrace();
      System.exit(1);
    }
 </pre>
 <p>
 Immediately after connecting is the only real time you need to check the
 reply code (because connect is of type void).  The convention for all the
 SMTP command methods in SMTPClient is such that they either return a
 boolean value or some other value.
 The boolean methods return true on a successful completion reply from
 the SMTP server and false on a reply resulting in an error condition or
 failure.  The methods returning a value other than boolean return a value
 containing the higher level data produced by the SMTP command, or null if a
 reply resulted in an error condition or failure.  If you want to access
 the exact SMTP reply code causing a success or failure, you must call
 <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#getReplyCode()"><code>getReplyCode </code></a> after
 a success or failure.
 <p>
 You should keep in mind that the SMTP server may choose to prematurely
 close a connection for various reasons.  The SMTPClient class will detect a
 premature SMTP server connection closing when it receives a
 <a href="../../../../../org/apache/commons/net/smtp/SMTPReply.html#SERVICE_NOT_AVAILABLE"><code>SMTPReply.SERVICE_NOT_AVAILABLE </code></a>
  response to a command.
 When that occurs, the method encountering that reply will throw
 an <a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp"><code>SMTPConnectionClosedException</code></a>
 .
 <code>SMTPConectionClosedException</code>
 is a subclass of <code> IOException </code> and therefore need not be
 caught separately, but if you are going to catch it separately, its
 catch block must appear before the more general <code> IOException </code>
 catch block.  When you encounter an
 <a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp"><code>SMTPConnectionClosedException</code></a>
 , you must disconnect the connection with
 <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#disconnect()"><code>disconnect() </code></a> to properly clean up the
 system resources used by SMTPClient.  Before disconnecting, you may check
 the last reply code and text with
 <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#getReplyCode()"><code>getReplyCode </code></a>,
 <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#getReplyString()"><code>getReplyString </code></a>,
 and
 <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#getReplyStrings()"><code>getReplyStrings</code></a>.
 <p>
 Rather than list it separately for each method, we mention here that
 every method communicating with the server and throwing an IOException
 can also throw a
 <a href="../../../../../org/apache/commons/net/MalformedServerReplyException.html" title="class in org.apache.commons.net"><code>MalformedServerReplyException</code></a>
 , which is a subclass
 of IOException.  A MalformedServerReplyException will be thrown when
 the reply received from the server deviates enough from the protocol
 specification that it cannot be interpreted in a useful manner despite
 attempts to be as lenient as possible.
 <p>
 <p></div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/net/smtp/SMTP.html" title="class in org.apache.commons.net.smtp"><code>SMTP</code></a>, 
<a href="../../../../../org/apache/commons/net/smtp/SimpleSMTPHeader.html" title="class in org.apache.commons.net.smtp"><code>SimpleSMTPHeader</code></a>, 
<a href="../../../../../org/apache/commons/net/smtp/RelayPath.html" title="class in org.apache.commons.net.smtp"><code>RelayPath</code></a>, 
<a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp"><code>SMTPConnectionClosedException</code></a>, 
<a href="../../../../../org/apache/commons/net/MalformedServerReplyException.html" title="class in org.apache.commons.net"><code>MalformedServerReplyException</code></a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_org.apache.commons.net.smtp.SMTP">
<!--   -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.commons.net.smtp.<a href="../../../../../org/apache/commons/net/smtp/SMTP.html" title="class in org.apache.commons.net.smtp">SMTP</a></h3>
<code><a href="../../../../../org/apache/commons/net/smtp/SMTP.html#_commandSupport_">_commandSupport_</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#DEFAULT_PORT">DEFAULT_PORT</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#encoding">encoding</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_org.apache.commons.net.SocketClient">
<!--   -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.commons.net.<a href="../../../../../org/apache/commons/net/SocketClient.html" title="class in org.apache.commons.net">SocketClient</a></h3>
<code><a href="../../../../../org/apache/commons/net/SocketClient.html#_defaultPort_">_defaultPort_</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#_input_">_input_</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#_output_">_output_</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#_serverSocketFactory_">_serverSocketFactory_</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#_socket_">_socket_</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#_socketFactory_">_socketFactory_</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#_timeout_">_timeout_</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#connectTimeout">connectTimeout</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#NETASCII_EOL">NETASCII_EOL</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#SMTPClient()">SMTPClient</a></strong>()</code>
<div class="block">Default SMTPClient constructor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#SMTPClient(java.lang.String)">SMTPClient</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encoding)</code>
<div class="block">Overloaded constructor that takes an encoding specification</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#addRecipient(org.apache.commons.net.smtp.RelayPath)">addRecipient</a></strong>(<a href="../../../../../org/apache/commons/net/smtp/RelayPath.html" title="class in org.apache.commons.net.smtp">RelayPath</a>&nbsp;path)</code>
<div class="block">Add a recipient for a message using the SMTP RCPT command, specifying
 a forward relay path.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#addRecipient(java.lang.String)">addRecipient</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;address)</code>
<div class="block">Add a recipient for a message using the SMTP RCPT command, the
 recipient's email address.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#completePendingCommand()">completePendingCommand</a></strong>()</code>
<div class="block">At least one SMTPClient method (<a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#sendMessageData()"><code>sendMessageData </code></a>)
 does not complete the entire sequence of SMTP commands to complete a
 transaction.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#listHelp()">listHelp</a></strong>()</code>
<div class="block">Fetches the system help information from the server and returns the
 full string.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#listHelp(java.lang.String)">listHelp</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;command)</code>
<div class="block">Fetches the help information for a given command from the server and
 returns the full string.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#login()">login</a></strong>()</code>
<div class="block">Login to the SMTP server by sending the HELO command with the
 client hostname as an argument.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#login(java.lang.String)">login</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;hostname)</code>
<div class="block">Login to the SMTP server by sending the HELO command with the
 given hostname as an argument.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#logout()">logout</a></strong>()</code>
<div class="block">Logout of the SMTP server by sending the QUIT command.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#reset()">reset</a></strong>()</code>
<div class="block">Aborts the current mail transaction, resetting all server stored
 sender, recipient, and mail data, cleaing all buffers and tables.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#sendMessageData()">sendMessageData</a></strong>()</code>
<div class="block">Send the SMTP DATA command in preparation to send an email message.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#sendNoOp()">sendNoOp</a></strong>()</code>
<div class="block">Sends a NOOP command to the SMTP server.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#sendShortMessageData(java.lang.String)">sendShortMessageData</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;message)</code>
<div class="block">A convenience method for sending short messages.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#sendSimpleMessage(java.lang.String, java.lang.String[], java.lang.String)">sendSimpleMessage</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;sender,
                                  <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;recipients,
                                  <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;message)</code>
<div class="block">A convenience method for a sending short email without having to
 explicitly set the sender and recipient(s).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#sendSimpleMessage(java.lang.String, java.lang.String, java.lang.String)">sendSimpleMessage</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;sender,
                                  <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;recipient,
                                  <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;message)</code>
<div class="block">A convenience method for a sending short email without having to
 explicitly set the sender and recipient(s).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#setSender(org.apache.commons.net.smtp.RelayPath)">setSender</a></strong>(<a href="../../../../../org/apache/commons/net/smtp/RelayPath.html" title="class in org.apache.commons.net.smtp">RelayPath</a>&nbsp;path)</code>
<div class="block">Set the sender of a message using the SMTP MAIL command, specifying
 a reverse relay path.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#setSender(java.lang.String)">setSender</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;address)</code>
<div class="block">Set the sender of a message using the SMTP MAIL command, specifying
 the sender's email address.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#verify(java.lang.String)">verify</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;username)</code>
<div class="block">Verify that a username or email address is valid, i.e., that mail
 can be delivered to that mailbox on the server.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.commons.net.smtp.SMTP">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.commons.net.smtp.<a href="../../../../../org/apache/commons/net/smtp/SMTP.html" title="class in org.apache.commons.net.smtp">SMTP</a></h3>
<code><a href="../../../../../org/apache/commons/net/smtp/SMTP.html#_connectAction_()">_connectAction_</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#data()">data</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#disconnect()">disconnect</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#expn(java.lang.String)">expn</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#getCommandSupport()">getCommandSupport</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#getReply()">getReply</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#getReplyCode()">getReplyCode</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#getReplyString()">getReplyString</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#getReplyStrings()">getReplyStrings</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#helo(java.lang.String)">helo</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#help()">help</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#help(java.lang.String)">help</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#mail(java.lang.String)">mail</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#noop()">noop</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#quit()">quit</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#rcpt(java.lang.String)">rcpt</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#removeProtocolCommandistener(org.apache.commons.net.ProtocolCommandListener)">removeProtocolCommandistener</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#rset()">rset</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#saml(java.lang.String)">saml</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#send(java.lang.String)">send</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#sendCommand(int)">sendCommand</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#sendCommand(int, java.lang.String)">sendCommand</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#sendCommand(java.lang.String)">sendCommand</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#sendCommand(java.lang.String, java.lang.String)">sendCommand</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#soml(java.lang.String)">soml</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#turn()">turn</a>, <a href="../../../../../org/apache/commons/net/smtp/SMTP.html#vrfy(java.lang.String)">vrfy</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.commons.net.SocketClient">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.commons.net.<a href="../../../../../org/apache/commons/net/SocketClient.html" title="class in org.apache.commons.net">SocketClient</a></h3>
<code><a href="../../../../../org/apache/commons/net/SocketClient.html#addProtocolCommandListener(org.apache.commons.net.ProtocolCommandListener)">addProtocolCommandListener</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#connect(java.net.InetAddress)">connect</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#connect(java.net.InetAddress, int)">connect</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#connect(java.net.InetAddress, int, java.net.InetAddress, int)">connect</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#connect(java.lang.String)">connect</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#connect(java.lang.String, int)">connect</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#connect(java.lang.String, int, java.net.InetAddress, int)">connect</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#createCommandSupport()">createCommandSupport</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#fireCommandSent(java.lang.String, java.lang.String)">fireCommandSent</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#fireReplyReceived(int, java.lang.String)">fireReplyReceived</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getCharset()">getCharset</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getCharsetName()">getCharsetName</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getConnectTimeout()">getConnectTimeout</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getDefaultPort()">getDefaultPort</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getDefaultTimeout()">getDefaultTimeout</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getKeepAlive()">getKeepAlive</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getLocalAddress()">getLocalAddress</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getLocalPort()">getLocalPort</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getProxy()">getProxy</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getReceiveBufferSize()">getReceiveBufferSize</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getRemoteAddress()">getRemoteAddress</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getRemotePort()">getRemotePort</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getSendBufferSize()">getSendBufferSize</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getServerSocketFactory()">getServerSocketFactory</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getSoLinger()">getSoLinger</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getSoTimeout()">getSoTimeout</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#getTcpNoDelay()">getTcpNoDelay</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#isAvailable()">isAvailable</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#isConnected()">isConnected</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#removeProtocolCommandListener(org.apache.commons.net.ProtocolCommandListener)">removeProtocolCommandListener</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setCharset(java.nio.charset.Charset)">setCharset</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setConnectTimeout(int)">setConnectTimeout</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setDefaultPort(int)">setDefaultPort</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setDefaultTimeout(int)">setDefaultTimeout</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setKeepAlive(boolean)">setKeepAlive</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setProxy(java.net.Proxy)">setProxy</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setReceiveBufferSize(int)">setReceiveBufferSize</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setSendBufferSize(int)">setSendBufferSize</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setServerSocketFactory(javax.net.ServerSocketFactory)">setServerSocketFactory</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setSocketFactory(javax.net.SocketFactory)">setSocketFactory</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setSoLinger(boolean, int)">setSoLinger</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setSoTimeout(int)">setSoTimeout</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#setTcpNoDelay(boolean)">setTcpNoDelay</a>, <a href="../../../../../org/apache/commons/net/SocketClient.html#verifyRemote(java.net.Socket)">verifyRemote</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="SMTPClient()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SMTPClient</h4>
<pre>public&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.131">SMTPClient</a>()</pre>
<div class="block">Default SMTPClient constructor.  Creates a new SMTPClient instance.</div>
</li>
</ul>
<a name="SMTPClient(java.lang.String)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SMTPClient</h4>
<pre>public&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.138">SMTPClient</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encoding)</pre>
<div class="block">Overloaded constructor that takes an encoding specification</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>encoding</code> - The encoding to use</dd><dt><span class="strong">Since:</span></dt>
  <dd>2.0</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="completePendingCommand()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>completePendingCommand</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.175">completePendingCommand</a>()
                               throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">At least one SMTPClient method (<a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#sendMessageData()"><code>sendMessageData </code></a>)
 does not complete the entire sequence of SMTP commands to complete a
 transaction.  These types of commands require some action by the
 programmer after the reception of a positive intermediate command.
 After the programmer's code completes its actions, it must call this
 method to receive the completion reply from the server and verify the
 success of the entire transaction.
 <p>
 For example,
 <pre>
 writer = client.sendMessage();
 if(writer == null) // failure
   return false;
 header =
  new SimpleSMTPHeader("foobar@foo.com", "foo@foobar.com", "Re: Foo");
 writer.write(header.toString());
 writer.write("This is just a test");
 writer.close();
 if(!client.completePendingCommand()) // failure
   return false;
 </pre>
 <p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="login(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>login</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.196">login</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;hostname)
              throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Login to the SMTP server by sending the HELO command with the
 given hostname as an argument.  Before performing any mail commands,
 you must first login.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>hostname</code> - The hostname with which to greet the SMTP server.</dd>
<dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="login()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>login</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.216">login</a>()
              throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Login to the SMTP server by sending the HELO command with the
 client hostname as an argument.  Before performing any mail commands,
 you must first login.
 <p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="setSender(org.apache.commons.net.smtp.RelayPath)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSender</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.248">setSender</a>(<a href="../../../../../org/apache/commons/net/smtp/RelayPath.html" title="class in org.apache.commons.net.smtp">RelayPath</a>&nbsp;path)
                  throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Set the sender of a message using the SMTP MAIL command, specifying
 a reverse relay path.  The sender must be set first before any
 recipients may be specified, otherwise the mail server will reject
 your commands.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>path</code> - The reverse relay path pointing back to the sender.</dd>
<dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="setSender(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSender</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.270">setSender</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;address)
                  throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Set the sender of a message using the SMTP MAIL command, specifying
 the sender's email address. The sender must be set first before any
 recipients may be specified, otherwise the mail server will reject
 your commands.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>address</code> - The sender's email address.</dd>
<dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="addRecipient(org.apache.commons.net.smtp.RelayPath)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addRecipient</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.292">addRecipient</a>(<a href="../../../../../org/apache/commons/net/smtp/RelayPath.html" title="class in org.apache.commons.net.smtp">RelayPath</a>&nbsp;path)
                     throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Add a recipient for a message using the SMTP RCPT command, specifying
 a forward relay path.  The sender must be set first before any
 recipients may be specified, otherwise the mail server will reject
 your commands.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>path</code> - The forward relay path pointing to the recipient.</dd>
<dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="addRecipient(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addRecipient</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.314">addRecipient</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;address)
                     throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Add a recipient for a message using the SMTP RCPT command, the
 recipient's email address.  The sender must be set first before any
 recipients may be specified, otherwise the mail server will reject
 your commands.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>address</code> - The recipient's email address.</dd>
<dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="sendMessageData()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendMessageData</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</a>&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.360">sendMessageData</a>()
                       throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Send the SMTP DATA command in preparation to send an email message.
 This method returns a DotTerminatedMessageWriter instance to which
 the message can be written.  Null is returned if the DATA command
 fails.
 <p>
 You must not issue any commands to the SMTP server (i.e., call any
 (other methods) until you finish writing to the returned Writer
 instance and close it.  The SMTP protocol uses the same stream for
 issuing commands as it does for returning results.  Therefore the
 returned Writer actually writes directly to the SMTP connection.
 After you close the writer, you can execute new commands.  If you
 do not follow these requirements your program will not work properly.
 <p>
 You can use the provided
 <a href="../../../../../org/apache/commons/net/smtp/SimpleSMTPHeader.html" title="class in org.apache.commons.net.smtp"><code>SimpleSMTPHeader</code></a>
 class to construct a bare minimum header.
 To construct more complicated headers you should
 refer to RFC 822.  When the Java Mail API is finalized, you will be
 able to use it to compose fully compliant Internet text messages.
 The DotTerminatedMessageWriter takes care of doubling line-leading
 dots and ending the message with a single dot upon closing, so all
 you have to worry about is writing the header and the message.
 <p>
 Upon closing the returned Writer, you need to call
 <a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#completePendingCommand()"><code>completePendingCommand() </code></a>
 to finalize the transaction and verify its success or failure from
 the server reply.
 <p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>A DotTerminatedMessageWriter to which the message (including
      header) can be written.  Returns null if the command fails.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="sendShortMessageData(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendShortMessageData</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.388">sendShortMessageData</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;message)
                             throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">A convenience method for sending short messages.  This method fetches
 the Writer returned by <a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#sendMessageData()"><code>sendMessageData() </code></a>
 and writes the specified String to it.  After writing the message,
 this method calls <a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#completePendingCommand()"><code>completePendingCommand() </code></a>
  to finalize the transaction and returns
 its success or failure.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>message</code> - The short email message to send.</dd>
<dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="sendSimpleMessage(java.lang.String, java.lang.String, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendSimpleMessage</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.425">sendSimpleMessage</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;sender,
                        <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;recipient,
                        <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;message)
                          throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">A convenience method for a sending short email without having to
 explicitly set the sender and recipient(s).  This method
 sets the sender and recipient using
 <a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#setSender(org.apache.commons.net.smtp.RelayPath)"><code>setSender </code></a> and
 <a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#addRecipient(org.apache.commons.net.smtp.RelayPath)"><code>addRecipient </code></a>, and then sends the
 message using <a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#sendShortMessageData(java.lang.String)"><code>sendShortMessageData </code></a>.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>sender</code> - The email address of the sender.</dd><dd><code>recipient</code> - The email address of the recipient.</dd><dd><code>message</code> - The short email message to send.</dd>
<dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="sendSimpleMessage(java.lang.String, java.lang.String[], java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendSimpleMessage</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.462">sendSimpleMessage</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;sender,
                        <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;recipients,
                        <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;message)
                          throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">A convenience method for a sending short email without having to
 explicitly set the sender and recipient(s).  This method
 sets the sender and recipients using
 <a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#setSender(org.apache.commons.net.smtp.RelayPath)"><code>setSender </code></a> and
 <a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#addRecipient(org.apache.commons.net.smtp.RelayPath)"><code>addRecipient </code></a>, and then sends the
 message using <a href="../../../../../org/apache/commons/net/smtp/SMTPClient.html#sendShortMessageData(java.lang.String)"><code>sendShortMessageData </code></a>.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>sender</code> - The email address of the sender.</dd><dd><code>recipients</code> - An array of recipient email addresses.</dd><dd><code>message</code> - The short email message to send.</dd>
<dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="logout()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>logout</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.500">logout</a>()
               throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Logout of the SMTP server by sending the QUIT command.
 <p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="reset()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reset</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.520">reset</a>()
              throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Aborts the current mail transaction, resetting all server stored
 sender, recipient, and mail data, cleaing all buffers and tables.
 <p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="verify(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>verify</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.540">verify</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;username)
               throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Verify that a username or email address is valid, i.e., that mail
 can be delivered to that mailbox on the server.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>username</code> - The username or email address to validate.</dd>
<dt><span class="strong">Returns:</span></dt><dd>True if the username is valid, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="listHelp()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>listHelp</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.565">listHelp</a>()
                throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Fetches the system help information from the server and returns the
 full string.
 <p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>The system help string obtained from the server.  null if the
       information could not be obtained.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
  command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="listHelp(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>listHelp</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.589">listHelp</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;command)
                throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Fetches the help information for a given command from the server and
 returns the full string.
 <p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>command</code> - The command on which to ask for help.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The command help string obtained from the server.  null if the
       information could not be obtained.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
  command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
<a name="sendNoOp()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>sendNoOp</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/smtp/SMTPClient.html#line.611">sendNoOp</a>()
                 throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Sends a NOOP command to the SMTP server.  This is useful for preventing
 server timeouts.
 <p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>True if successfully completed, false if not.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/net/smtp/SMTPConnectionClosedException.html" title="class in org.apache.commons.net.smtp">SMTPConnectionClosedException</a></code> - If the SMTP server prematurely closes the connection as a result
      of the client being idle or some other reason causing the server
      to send SMTP reply code 421.  This exception may be caught either
      as an IOException or independently as itself.</dd>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs while either sending a
      command to the server or receiving a reply from the server.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SMTPClient.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/net/smtp/SMTP.html" title="class in org.apache.commons.net.smtp"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/net/smtp/SMTPCommand.html" title="class in org.apache.commons.net.smtp"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/net/smtp/SMTPClient.html" target="_top">Frames</a></li>
<li><a href="SMTPClient.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields_inherited_from_class_org.apache.commons.net.smtp.SMTP">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2001-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>
